package com.my.study.controller;

import com.my.study.annotation.JobHandler;
import com.my.study.annotation.JobMethodHandler;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.stereotype.Component;

/**
 * @author: yidujun
 * @create: 2021/04/27 18:37
 */
@Slf4j
@JobHandler(name = "testJob")
@Component
public class TestJob implements Job {

    @Override
    @JobMethodHandler(name = "schedulerTestJob", cron = "*/5 * * * * ?", start = "1")
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("TestJob time:{}", System.currentTimeMillis() / 1000);
    }

}
